package com.sc.VenusQueryBeta.model.login;

import com.hengjun.kingstar.sdk.base.BaseModel;
import com.hengjun.kingstar.sdk.helper.RetrofitCreateHelper;
import com.hengjun.kingstar.sdk.helper.RxHelper;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.api.login.LoginApi;
import com.sc.VenusQueryBeta.contract.login.NextRegistContract;
import com.sc.VenusQueryBeta.model.bean.login.ComfirmRegistrationBean;
import com.sc.VenusQueryBeta.model.bean.login.RegistBean;

import io.reactivex.Observable;

/**
 * 下一步契约模型
 */

public class NextRegistModel extends BaseModel implements NextRegistContract.INextModel {
    public static NextRegistModel newInstance(){
        return new NextRegistModel();
    }
    /**
     * 直接注册
     * @param id
     * @param smsCode
     * @param password
     * @param clientUID
     * @param deviceUID
     * @param deviceType
     * @param areaCode
     * @return
     */
    @Override
    public Observable<RegistBean> regist(String id, String smsCode, String password, String clientUID, String deviceUID, String deviceType, String areaCode) {
        return RetrofitCreateHelper.createApi(LoginApi.class, Host.HostVGSestMessageserver).regist(id,smsCode,password,clientUID,deviceUID,deviceType,areaCode).compose(RxHelper.<RegistBean>rxSchedulerHelper());
    }


    /**
     * 确认注册
     * @param id
     * @param smsCode
     * @param password
     * @param clientUID
     * @param deviceUID
     * @param deviceType
     * @return
     */
    @Override
    public Observable<ComfirmRegistrationBean> confirmRegist(String id, String smsCode, String password, String clientUID, String deviceUID, String deviceType) {
        return RetrofitCreateHelper.createApi(LoginApi.class, Host.HostVGSestMessageserver).getComfirmRegistration(id,smsCode,password,clientUID,deviceUID,deviceType).compose(RxHelper.<ComfirmRegistrationBean>rxSchedulerHelper());
    }

}
